//
//  FlickrAPI.h
//  pkphotomap
//
//  Created by Ed Mancebo on 3/24/11.
//  Copyright 2011 Personal. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import "PKImage.h"
#import "AuthResult.h"
#import "UploadInfo.h"
#import "PostResult.h"

@interface FlickrAPI : NSObject {

}

// searches for images within specified region
// returns list of image IDs
+ (NSMutableArray*) searchRegionMin:(CLLocationCoordinate2D)minCoord max:(CLLocationCoordinate2D)maxCoord;

// valid sizes one of {s, t, m, z, b}
// See: http://www.flickr.com/services/api/misc.urls.html
+ (UIImage*) getImage:(PKImage*)pkImage size:(NSString*)size;

// sets coordinates and other info properties
+ (void) setInfo:(PKImage*)pkImage;

+ (AuthResult*) authenticate:(NSString*)frob;

+ (PostResult*) addPhoto:(NSString*)photoId toGroup:(NSString*)groupId;
+ (PostResult*) uploadPhoto:(UploadInfo*)uploadInfo;
+ (PostResult*) setPhotoLocation:(NSString*)photoId coord:(CLLocationCoordinate2D)coord;

// private
+ (NSDictionary*) callFlickrWithRequestString:(NSString*)requestString;
+ (NSString*) signedQueryStringFromArgs:(NSDictionary*)args;
+ (NSString*) apiSigFromArgs:(NSDictionary*)args;
+ (NSString*) calculateMd5:(NSString*)str;
+ (PostResult*) postToUrl:(NSString*)urlString postData:(NSDictionary*)postData photo:(UIImage*)photo;
+ (void) incrementApiCount;

@end
